CUBE CONNECT Edition Help

Examples and FAQ

This section contains examples using the Pilot program, along with a link to Frequently Asked Questions.

Example 1: Typical application, with no logic

/* Example 1: Typical application, with no logic. */
 
RUN PGM=NETWORK
 . data for NETWORK to build a network
ENDRUN
RUN PGM=HIGHWAY
. data for HIGHWAY to build LOS files
ENDRUN
RUN PGM=DISTRIBUTION
. data for DISTRIBUTION to distribute trip ends
ENDRUN
RUN PGM=MATRIX
. data for MATRIX to combine and factor matrices
ENDRUN
RUN PGM=HIGHWAY
. data for HIGHWAY to load trips to highway network
ENDRUN
RUN PGM=NETWORK
. data for NETWORK to analyze assignment
ENDRUN

Example 2: Loop

This example is a little more complicated. All the RUN statements would have statements following them (including an ENDRUN statement). They are excluded, so that process can be presented more briefly.

LOOP iter=1,5
COMP ID='This is iteration' + str(iter,2,0)
RUN PGM=NETWORK
RUN PGM=HIGHWAY
RUN PGM=DISTTRIBUTION
RUN PGM=MATRIX
RUN PGM=HIGHWAY
RUN PGM=NETWORK
ENDRUN
IF ( NETWORK.RESULT <= 0.02) BREAK ; criteria already satisfied 
ENDLOOP

Example 3: Additional Logic

This example introduces more capabilities, including branching with GOTO statements, page breaks with NEWPAGE, and output via REPORT.

LOOP iter=1,5
COMP ID='This is iteration' + str(iter,2,0)
RUN  PGM=NETWORK
RUN  PGM=HIGHWAY
RUN  PGM=DISTTRIBUTION
RUN  PGM=MATRIX
RUN  PGM=HIGHWAY
RUN  PGM=NETWORK
ENDRUN
IF ( NETWORK.RESULT <= 0.02) 
     GOTO Early_Converge
ELSEIF (NETWORK.RESULT <= 0.04) 
     LIST=' exit early ' + str(iter,2,0) + ' iterations’ 
     GOTO TRANSIT
ENDIF
ENDLOOP
LIST='Speeds did not converge'
EXIT
:Early_converge
LIST='Convergence after ' + str(iter,2,0) + ' iterations'
:TRANSIT
ID=BEGIN TRANSIT PROCESSING
REPORT vars=y ; list current variables
Newpage BEFORESYS=y, AFTERSYS=y
; copy transit files to ramdisk
*COPY  d:\transit\neta\altx*.*  r:  
RUN  PGM=PUBLIC TRANSPORT
read r:altx01.set
ENDRUN
IF (RETURNCODE > 0) EXIT
*COPY  r:trnnet   d:\transit\neta

Frequently Asked Questions

Please see FAQ - Pilot and general syntax